The present invention relates to a sensor device and method for measuring a property associated with the introduction of or changes in a chemical, biological or physical stimulus in a localized environment, in particular to a sensor device and method for measuring the partition coefficient of a stimulus.